<?php

//Enable Custom Menus
if ( function_exists( 'add_theme_support' ) ) { 
	add_theme_support( 'menus' ); 
}

if ( function_exists( 'register_nav_menu' ) ) { 
	register_nav_menu( 'primary', 'Primary Menu' );
}

// Enable Custom Background
if ( function_exists( 'add_custom_background' ) ) { 
	add_custom_background();
}

//Enable Post Thumbnails
if ( function_exists( 'add_theme_support' ) ) {
add_theme_support( 'post-thumbnails' );
add_image_size( 'archive-thumbnail', 200, 121, true );
set_post_thumbnail_size( 200, 121);
}

//Enable Feed Links
if ( function_exists( 'add_theme_support' ) ) {
add_theme_support( 'automatic-feed-links');
}

//Enable Register Sidebar
if ( function_exists('register_sidebar') ) {
register_sidebar(array('name' => 'Right Sidebar','before_widget' => '','after_widget' => '','before_title' => '<h3>','after_title' => '</h3>'));
register_sidebar(array('name' => 'Footer Left','before_widget' => '','after_widget' => '','before_title' => '<h3>','after_title' => '</h3>'));
register_sidebar(array('name' => 'Footer Center Left','before_widget' => '','after_widget' => '','before_title' => '<h3>','after_title' => '</h3>'));
register_sidebar(array('name' => 'Footer Center Right','before_widget' => '','after_widget' => '','before_title' => '<h3>','after_title' => '</h3>'));
register_sidebar(array('name' => 'Footer Right','before_widget' => '','after_widget' => '','before_title' => '<h3>','after_title' => '</h3>'));
}

//Enable Custom Post Type
if ( function_exists('register_post_type') ) {
	register_post_type('product', array( 'label' => 'Products','description' => 'All Products','public' => true,'show_ui' => true,'show_in_menu' => true,'capability_type' => 'post','hierarchical' => false,'rewrite' => array('slug' => ''),'query_var' => true,'supports' => array('title','editor','excerpt','trackbacks','custom-fields','comments','revisions','thumbnail','author','page-attributes',),'taxonomies' => array('category','post_tag',),'labels' => array ( 'name' => 'Products', 'singular_name' => 'Product', 'menu_name' => 'Products', 'add_new' => 'Add Product', 'add_new_item' => 'Add New Product', 'edit' => 'Edit', 'edit_item' => 'Edit Product', 'new_item' => 'New Product', 'view' => 'View Product', 'view_item' => 'View Product', 'search_items' => 'Search Products', 'not_found' => 'No Products Found', 'not_found_in_trash' => 'No Products Found in Trash', 'parent' => 'Parent Product',),));
}

// Image resize in content
// To Use: [img w=600 h=200 class=alignleft alt=My Photo]http://mysite.com/photo.jpg[/img]
function timmyimg($atts, $content = null) {
	extract(shortcode_atts(array(
		'w' => '600',
		'h' => '250',
		'zc' => '0',
		'a' => 'c',
		'q' => '100',
		'class' => 'alignnone',
		'alt' => ''
	), $atts));
	return "<img src='". get_bloginfo('template_directory') . "/timthumb.php?src=".$content."&w=".$w."&h=".$h."&zc=".$zc."&q=".$q."&a=".$a."' alt='".$alt."' class='wp-post-img ".$class."' />";
}
add_shortcode('img', 'timmyimg');

?>